package cn.edu.shu.wechat.core.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import cn.edu.shu.wechat.core.token.MyToken;

public class UpdateAccessToken {
	private static final Logger logger = LoggerFactory.getLogger(UpdateAccessToken.class);
	private MyToken myToken;

	/**
	 * 定时刷新access_token
	 */
	public void sync() {
		if (myToken.request()) {
			logger.info("update access_token success..." + myToken.getToken());
		} else {
			logger.error("update access_token error!");
		}
	}

	public void setMyToken(MyToken myToken) {
		this.myToken = myToken;
	}
	

}
